<?php
namespace  My\Controller;
use Utuo\BackgroundController;
class MicroAllianceController extends BackgroundController{
	
		public function _initialize() {
			$this->setControllerTitle('微联盟');
			$this->setActionTitle(array(
			'index' => '微联盟列表',
			'add' => '微联盟添加',
			'modify' => '微联盟修改',
			'recycle' => '回收站',
		));
		$this->setActionNav(array(
				'index',
				'add',
				'recycle'
		));
		
	}
	public function getLists($is_deleted){
		$condation=array(
			'cid'=>$this->aid,
			'is_deleted'=>$is_deleted,	
		);
		$microAlliance=M('MicroAlliance')->where($condation)->page($this->getPage(),$this->getPageSize())->order('id desc')->select();
		foreach ($microAlliance as &$v)
		{
			$v['url']=$_SERVER['HTTP_HOST'].U('Home/MicroAlliance/index',array('sid'=>$this->aid,'id'=>$v['id']));
		}
		$count=M('MicroAlliance')->where($condation)->count();
		$this->showPage($count, $this->getPageSize());
		$this->assign("microAlliance",$microAlliance);
		$this->display();
	}
}